package com.caigou.modules.info.network.api

import com.caigou.comm.base.bean.HttpResult
import com.caigou.modules.info.bean.InfoBean
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author #Suyghur.
 * Created on 2021/09/23
 */
interface HttpInfoApiService {
    @GET("/api/folk/data/list")
    fun getArticleList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("userId") userId: String,
        @Query("sort") sort: Int,
        @Query("type") type: Int
    ): Flow<HttpResult<InfoBean>>


    @GET("/api/folk/data/my/list")
    fun getMyInfoList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("userId") userId: String,
        @Query("checkStatus") checkStatus: Int
    ): Flow<HttpResult<InfoBean>>

    @GET("/api/folk/data/collect/list")
    fun getMyCollectedList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("userId") userId: String
    ): Flow<HttpResult<InfoBean>>

    @POST("/api/folk/data/like")
    fun setInfoLike(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/folk/data/send")
    fun publishInfo(@Body body: RequestBody): Flow<HttpResult<String>>
}